<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>scope隔离作用域之@单向文本绑定</title>
		<script src="../org/angular.min.js" ></script>
	</head>
	<body>
		<div ng-app = "hd" ng-controller="ctrl">
			<input type="text" ng-model="color" />
			<h1 hdcms hcolor="{{color}}"></h1>
		</div> 
		<script>
			var m = angular.module('hd',[]);
			m.directive('hdcms',[function(){
				return{
					restrict:'AEC',
					template:"{{color}}<span style='color:{{colors}}'>人人</span>",
					scope:{colors:'@hcolor'}
				}
			}]);
			m.controller("ctrl",['$scope',function($scope){
				$scope.color = 'red';
				$scope.name="renren"; 
			}]);
		</script>
	</body>
</html>
